<template>
    <div>
        <!-- 车队管理 -->
        <!-- 左侧导航栏 -->
        <el-row>
            <el-col :span="4" class="left-nav">
                <el-menu
                        :default-active="dfActive"
                        class="el-menu-vertical-demo">
                    <el-submenu index="1">
                        <template slot="title">
                            <i class="el-icon-setting"></i>&nbsp;
                            <span>排班管理</span>
                        </template>
                        <el-menu-item-group>
                            <el-menu-item index="1-1" @click="jumpTo(1)">车辆排班</el-menu-item>
                            <el-menu-item index="1-2" @click="jumpTo(2)">驾驶员排班</el-menu-item>
                        </el-menu-item-group>
                    </el-submenu>
                </el-menu>
            </el-col>
            <!-- 路由 -->
            <el-col :span="20" class="router-container">
                <router-view @sendActive="getActive"></router-view>
            </el-col>
        </el-row>
    </div>

</template>

<script>
    export default {
        data: function(){
            return {
                dfActive:"1-1"
            }
        },
        methods:{
            jumpTo(i){
                switch(i){
                    case 1:this.$router.push("/index/carManage/vehicleSchedul");break;
                    case 2:this.$router.push("/index/carManage/driverSchedul");break;
                }
            },
            getActive(val){
                this.dfActive=val;
                console.log(this.dfActive)
            }
        },
        computed:{},
        watch:{},
        mounted() {
            this.$emit("sendTag",11);
        }
    }
</script>

<style scoped>
</style>